<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// 代理商后台主体路由组
Route::group(array('before' => 'after'), function()
{

    /** 
     * 界面主体
     */
    
        //监控面板
        Route::any('/', 'AdminController@index');

    /** 
     * 设备管理
     */
    
        //设备信息查询
        Route::any('deviceInfo/{group?}', 'DeviceController@info');

        //设备信息修改
        Route::any('deviceEdit/{device?}', 'DeviceController@edit');

        //设备绑定
        Route::any('deviceBind/{device?}', 'DeviceController@bind');

        //图表数据获取
        Route::any('devicePoint', 'DeviceController@point');
        
        //获取设备充值日志
        Route::get('deviceLog/{device}','DeviceController@getDeviceLog');
        
        //设备返修
        Route::get('deviceRepair','DeviceController@getDeviceRepair');
        Route::post('deviceRepair','DeviceController@postDeviceRepair');
        Route::get('deviceRepairs','DeviceController@getDeviceRepairs');
        Route::get('getRepair/{id}','DeviceController@getDeviceRepairMsg');
        Route::get('repairsearch','DeviceController@getDeviceSearch');

    /** 
     * 小区管理
     */
    
        //分组管理
        Route::any('groupArrange/{group?}', 'GroupController@arrange')->where('group', '[0-9]+');

        //分组创建
        Route::any('groupCreate', 'GroupController@create');

        //分组设定
        Route::any('groupSetting', 'GroupController@setting');

        //分组详情
        Route::any('groupInfo/{id?}', 'GroupController@info');

    /** 
     * 代理商管理
     */
    
        //分组管理
        Route::any('agent', 'AdminController@agents');
});

//代理商后台登录路由组
Route::group(array('before' => 'after'), function()
{
    //登录界面
    Route::get('login', 'AdminController@login');

    //登录验证
    Route::post('loginCheck', 'AdminController@loginCheck');

    //登出
    Route::any('logout', 'AdminController@logout');

    //信息/密码修改(1.信息修改; 2.密码修改)
    Route::any('userEdit/{type}', 'AdminController@edit');

});
